[% setvar title No overloading of f($arg) basing on ref($arg) %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>No overloading of f($arg) basing on ref($arg)</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: Ilya Zakharevich &lt;<a href='mailto:ilya@math.ohio-state.edu'>ilya@math.ohio-state.edu</a>&gt;
  Date: 15 Sep 2000
  Mailing List: <a href='mailto:perl6-language@perl.org'>perl6-language@perl.org</a>
  Number: 242
  Version: 1
  Status: Developing</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>This RFC proposes that the meaning of function calls and operators
should not be subtly changed basing on whether the argument is a reference
or not.</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>There are several proposals to switch the meaning of <code>f($arg)</code> basing on
the whether $arg is an array reference or not.  For example, it is tempting
to allow <code>$array[[2,3]]</code> denote the same as <code>$array[2][3]</code>.</p>
<p>Unfortunately, this prohibits the usage of overloaded data in $arg.  For
example</p>
<pre>  my $i23 = new Math::BigInt 23;
  print $array[$i23]</pre>
<p>will not access <code>$array[23]</code>, but <code>$array[2][3]</code> if the internal
representation if $i23 is (blessed) <code>[2,3]</code>.</p>
<p>Keeping in mind that overloaded objects can be made to behave as array
references even if they are not (see the key <code>'@{}'</code> of overloading)
makes things yet more confusing.</p>
<a name='MIGRATION ISSUES'></a><h1>MIGRATION ISSUES</h1>
<p>None.</p>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>None.</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p>None.</p>
</div>
